<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- author = Wink Hosting (www.winkhosting.com) -->

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta name="generator" content=
  "HTML Tidy for Linux (vers 1 September 2005), see www.w3.org" />
  <meta http-equiv="content-type" content=
  "text/html; charset=us-ascii" />
  <meta name="description" content="description" />
  <meta name="keywords" content="keywords" />
  <meta name="author" content="author" />
  <link rel="shortcut icon" type="image/x-icon" href=
  "http://awk.googlecode.com/svn/branches/tiny/img/favicon.ico" />
  <title>TinyMining : lib.awk</title>
<style type="text/css">
/*<![CDATA[*/
/* 
CSS Document 
Wink Hosting (www.winkhosting.com)
Designed By Alexis Corredor
alexis.corredor@gmail.com
*/
body {
margin-top: 0px;
margin-left: 0px;
margin-right: 0px;
margin-bottom: 0px;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 11px; 
text-align: left;
align: left;
}
p.left {text-align: left}
/*HEADER*/
#header{
width: 800px;
position:relative; 
height: 162px;
background-image:url(http://awk.googlecode.com/svn/branches/tiny/img/header.jpg);
background-repeat:no-repeat;
}
/*COMPANY NAME IN HEADER*/
#companyname {
position:absolute;
font-family: Verdana, Arial, Helvetica, sans-serif;
color: #FFFFFF;
font-size: 30px;
font-weight: bold;
margin-top:30px;
margin-left:40px;
left: 0px;
top: 0px;
}
#companyname a{
font-family: Verdana, Arial, Helvetica, sans-serif;
color:#FFFFFF;
text-decoration:none;
}
#companyname a:hover{
text-decoration:underline;
}
/*MENU IN HEADER*/
#menu{
position:absolute;
bottom: 20px;
right: 30px;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
font-weight: bold;
}
#menu a{
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
font-weight: bold;
color:#333333;
text-decoration:none;
}
#menu a:hover{
text-decoration:underline;
}
/*LEFT PANEL (News, Links, etc.)*/
#leftpanel{
float:left;
width:200px;
}
/*CONTENT*/
#content{
width: 800px;
}
#contenttext{
text-align: left;
float: right;
width: 580px;
}
/*FOOTER*/
.footer{
width: 779px;
height: 32px;
background-image:url(http://awk.googlecode.com/svn/branches/tiny/img/bg_footer.gif);
background-repeat:no-repeat;
clear:both;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
font-weight: bold;
color:#FFFFFF;
}
/*FOOTER LINKS*/
.footer a{
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
font-weight: bold;
color:#FFFFFF;
text-decoration:none;
}
.footer a:hover{
text-decoration:underline;
}
/*TABLE*/
.table_top{
width: 204px; 
height: 27px;
background-image:url(http://awk.googlecode.com/svn/branches/tiny/img/table_top.jpg);
background-repeat:no-repeat;
}
.table_content{
width: 204px;
background-image:url(http://awk.googlecode.com/svn/branches/tiny/img/table_content.jpg);
background-repeat:repeat-y;
}
.table_text{
margin-left:15px;
margin-right:15px;
text-align:justify;
}
.table_bottom{
width: 204px; height: 23px;
}
/*TEXT STYLES*/
.news_date {    
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
font-weight: bold;
color: #0099CC;
}
.body_text {    
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 11px; align: left;
}
.news_more {    
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
color: #FF9900;
font-weight: bold;
}
.news_text {    font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
}
.subtitle_gray {        
font-family:Verdana, Arial, Helvetica, sans-serif;      
font-weight: bold;
font-size: 14px;
color: #CCCCCC;
}
h1 {
margin-top: 0px; padding-top: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-weight: bold; font-size: 26px; color: #7DA5E0; 
}
.title_blue {
font-family: Verdana, Arial, Helvetica, sans-serif; font-weight: bold; font-size: 26px; color: #7DA5E0; 
}
.title_panel {  font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
font-weight: bold;
}
pre {
margin-left: 20px;
padding: 1em;
border: 1px dashed #2f6fab;
color: DarkBlue;
background-color: #f9f9f9;
line-height: 1.1em;
}
#title p {
float: right;
text-align: right;
text-width: 750px;
color: white; 
margin: 0 20px 0px 0; 
line-height: 1.2em;
padding-top: 5px;
padding-bottom: 5px;
padding-top: 20px;
}
p.tags {
font-size: x-small;
margin-top: 0px;
margin-botton: 0px;
text-align: right;
color: #AAA;
}
h1 h2 h3 h4 h5 h6 h7 { color:  #7DA5E0; }
h2 { border-top: 1px solid #7DA5E0; } 
/*]]>*/
</style>
</head>

<body>
  <div id="page" align="center">
    <div id="header">
     <div id="title">google-search  </div> 
      <div id="companyname" align="left">
        lib.awk
      </div>

      <div align="right" class="links_menu" id="menu">
	    mennu
      </div>
    </div><br />

    <div id="content">
      <div id="leftpanel">

        <div class="table_top">
          <div align="center">
            <span class="title_panel">News</span>
          </div>
        </div>

        <div class="table_content">
          <div class="table_text">

             news
          </div>
        </div>
    
        <div class="table_bottom">
          <img src="http://awk.googlecode.com/svn/branches/tiny/img/table_bottom.jpg"
          width="204" height="23" border="0" alt="" />
        </div>
        <p/>

        <div class="table_top">
          <div align="center">
            <span class="title_panel">News</span>
          </div>
        </div>

        <div class="table_content">
          <div class="table_text">
				Links
          </div>
        </div>
    
        <div class="table_bottom">
          <img src="http://awk.googlecode.com/svn/branches/tiny/img/table_bottom.jpg"
          width="204" height="23" border="0" alt="" />
        </div>
        <p/>
        <div class="table_top">
          <span class="title_panel">Links</span>
        </div>

        <div class="table_content">
          <div class="table_text">
			SEE also
          </div>
        </div>

        <div class="table_bottom">
          <img src="http://awk.googlecode.com/svn/branches/tiny/img/table_bottom.jpg"
          width="204" height="23" border="0" alt="" />
        </div>
        <p/>

      </div>

      <div id="contenttext">
         <img src="http://awk.googlecode.com/svn/branches/tiny/img/babel.jpg" align=right width=200  
		        style="margin: 3px; padding: 1px; border: 1px solid #CCC;">


<h1> BEGIN { 
         _ = SUBSEP 
         Q = "\"" 
         Pi= 3.1415926535
         Ee= 2.7182818284 
         Inf=10^32
         Pinch=1/Inf
       }
 function resetSeed(    seed) {
	if (seed) return(srand(seed))
	if(Seed)  return(srand(Seed))
	return srand(systime() + PROCINFO["pid"]) 
 }
 function sum(a, n,i) {
     for(i in a) n += a[i]
     return n
 }</h1>
<pre>
 ; sorts a[key]=value pairs
 function a2cdf(a,cdf,    some,n,i,j,sum,memo) {
     for(i in a) {
	 some  = rand() * Pinch
	 a[i] += Pinch
	 memo[a[i]] = i
     }
    cdf[0] = n = asort(a,sorted)
    sum = cdf[1] = sorted[1];
    for(i=2;i&lt;=length(sorted);i++) { 
        sum += sorted[i];
        cdf[i] = cdf[i-1] + sorted[i];
    }
    for(i in cdf)  
        cdf[i] = cdf[i] / sum
    for(i=1;i&lt;=n;i++)
        cdf[-1*i] = memo[sorted[i]]
 }
 function pick(cdf,   i) {
    i = pick1(cdf,rand(),cdf[0])
    return cdf[-1*i]
 }
 function pick1(cdf,u,n,  u,i) {
    for(i=n-1;i>=1;i--) if (u > cdf[i]) return i+1;
    return 1;
 }	 
 function norm(x,min,max) { 
 	return (x - min)/ (max - min + Pinch) 
 }
 function stddev(n,sum,sumSq,   tmp) {
    tmp = (sumSq-((sum*sum)/n))/(n-1)
	tmp = tmp &lt; 0 ? 0 : tmp
   return sqrt(tmp)
 }
 function gaussianPdf(m,s,x) {
    s = s + Pinch
    return 1/sqrt(2*Pi*s^2)*Ee^(-1*(x-m)^2/(2*s^2))
 }
 function round(x)      { 
	return int(x&lt;0 ? x-0.5 : x+0.5) 
 }
 function abs(n) { return n &lt; 0 ? -1*n : n }
 function odd(n) { return n % 2 } 
 function even(n) { return (n % 2) + 1 } 
 function median(a0,    sorted,a,n,half) {
	if (!sorted)  { asort(a0,a); return median(a,1) }
	half = int(n/2) 
	return odd(n) ? a[half] : (a[half] + a[half+1])/2 
  }
 function array(a) {
	split("",a)
  }
 function push(a,v,old) {
 	old      = length(a)
 	a[old+1] = v
 	return v
 }
 function pop(a,  old,v) {
 	old = length(a)
	v   = a[old]
	delete a[old]
	return v
 }
 function pretty(x) {
	gsub(_,",",x)
    return x
 }
 function trim(x) {
	sub(/^[ \t]*/,"",x)
	sub(/[ \t]*$/,"",x)
	return x
 }
 function o(a, str,control, i,com) {
      str = str ? str : "array"
      com = control ? control : " -n  -k 2" 
      com = "sort " com  " #" rand(); # ensure com is unique
      for(i in a) print oprim(str,i,a) | com;
      close(com) 
  }
 function oprim(str,i,a,  j) {
      j=i
      gsub(SUBSEP,",",j) 
      return str "[ " j " ]\t=\t [ " a[i] " ]"
 }
 function p2a(pairs,a,   sep,blankp,     n,tmp,i) {
	sep = sep ? sep : "/,/"
	n=split(pairs,tmp,sep)
	if (!blankp) 
		for(i in tmp) 
			tmp[i]=trim(tmp[i])
	for(i=1;i&lt;=n;i=i+2) 
		a[tmp[i]] = tmp[i+1] 
 }
 function rank(data0,ranks,     \
               data,starter,n,old,start,skipping,sum,i,j,r) {
     starter="someCraZYsymBOL";
     n     = asort(data0,data)    
     old   = starter
     start = 1;
     delete ranks;
     for(i=1;i&lt;=n;i++) {
	 skipping = (old == starter) || (data[i] == old);
	 if (skipping) {
	     sum += i 
	 } else {
	     r = sum/(i - start)
	     for(j=start;j&lt;i;j++) 
		 ranks[data[j]] = r;
	     start = i;
	     sum   = i;
	 }
	 old=data[i]
     }
     if (skipping) {
	 ranks[data[n]] = sum/(i - start)
     } else {
	 if (! (data[n] in ranks))
	     ranks[data[n]] = n #int(r+1.4999)
     }
 }
 function criticalValue(conf) {
     conf = conf ? conf  : 95
     if (conf==99) return 2.326
     if (conf==95) return 1.960 
     if (conf==90) return 1.645
 }
 function minMax(col,x,missing,min,max) {
    if(x == missing) return 1
	if(col in min) {if(x &lt; min[col]) {min[col]=x}} else {min[col]=x}
	if(col in max) {if(x > max[col]) {max[col]=x}} else {max[col]=x}
}
 function readHeader(col,x,       name,indx,num,sym,dep,indep,	\
                                  ignorep,nump,depp) {
	ignorep    = gsub(/\?/,"",x) 
	nump       = gsub(/\$/,"",x)
	depp       = gsub(/\!/,"",x) 
	indx[x]    = col
	name[col]  = x
	if (!ignorep)  {
		nump ? num[col] : sym[col]
		depp ? dep[col] : indep[col]
}}
 function discretize(col,rows,data,bins,want1,b1,c1,want2,b2,c2,\
                        all,n,row,sorted) {
    for(row=1;row&lt;=rows;row++)  
	all[row] = data[row,col]
    n    = asort(all,sorted)
    if(want1) efd(col,sorted,n,bins,b1,c1)
    if(want2) ewd(col,sorted,n,bins,b2,c2)
}
function efd(col,sorted,n,bins,b,c,   row,all,bin,i,jump,last) {
    bin  = last = 0
    i = jump = int(n/bins)
    while(i &lt; n) {
	if (sorted[i] == sorted[i+1]) {
	    i++
        } else {
	    bin++
	    b[col,bin] = sorted[i]
	    c[col,bin] = i - last
	    last = i
	    i += jump }}
    if ((n-last) > (c[col,bin]/2)) 
	bin++
    b[col,bin] = sorted[n]
    c[col,bin] += n - last
}
function ewd(col,sorted,n,bins,b,c,       min,max,jump,i,j) {
    min  = sorted[1]
    max  = sorted[n]
    jump = (max - min)/bins + 0.00000001
    for(i=1;i&lt;=bins;i++)
	b[col,i] = min + round(i* jump)
    j=1
    for(i=1;i&lt;=n;i++) {
	if(sorted[i]> b[col,j]) j++
	c[col, j]++
    }
}
function asBin(col,x,bins,breaks,  bin) {
    for(bin=1;bin&lt;=bins;bin++)
	if ((col,bin) in breaks)
	    if (x &lt;= breaks[col,bin])
		return bin
    return 1
}
function nchars(n,char,   out) {
    while(n> 0) {n--; out = out char}
    return out
}
function fyi(x) {
    print "#FYI: " x >>"/dev/stderr"
}

        <p>&nbsp;</p>
      </div><br />
      <br />

      <div class="footer">
			footer
      </div>
    </div>
  </div>
</body>
</html>


